package com.neuq.animaladoption.validation;

import com.neuq.animaladoption.anno.AnimalState;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class AnimalStateValidation implements ConstraintValidator<AnimalState,String> {
    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
        if(s==null){
            return false;
        }
        if(s.equals("已被收养")||s.equals("未被收养")||s.equals("去世")){
            return true;
        }
        return false;
    }
}
